﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Utils.MathUtilitys;

namespace Utils.Menu.Buttons
{
    public class CircleButton : AbstractButton
    {
        Vector2 pos;
        float radius;

        public Vector2 Pos { get { return pos; } set { pos = value; } }
        public float Radius { get { return radius; } set { radius = value; } }

        public CircleButton(ButtonListener listener, Vector2 pos, float radius)
            : base(listener)
        {
            this.pos = pos;
            this.radius = radius;
        }

        public override bool MouseInside(Vector2 mousePosition)
        {
            return (mousePosition - pos).LengthSquared() <= MathUtils.Sqr(radius);
        }
    }
}
